home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIXULTemplateBuilder.idl < prev    next >
Text File  |  2006-05-08  |  7KB  |  201 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *   Chris Waterson <waterson@netscape.com>
  24.  *   Ben Goodger <ben@netscape.com>
  25.  *   Jan Varga <varga@ku.sk>
  26.  *   Benjamin Smedberg <bsmedberg@covad.net>
  27.  *
  28.  * Alternatively, the contents of this file may be used under the terms of
  29.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  30.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  31.  * in which case the provisions of the GPL or the LGPL are applicable instead
  32.  * of those above. If you wish to allow use of your version of this file only
  33.  * under the terms of either the GPL or the LGPL, and not to allow others to
  34.  * use your version of this file under the terms of the MPL, indicate your
  35.  * decision by deleting the provisions above and replace them with the notice
  36.  * and other provisions required by the GPL or the LGPL. If you do not delete
  37.  * the provisions above, a recipient may use your version of this file under
  38.  * the terms of any one of the MPL, the GPL or the LGPL.
  39.  *
  40.  * ***** END LICENSE BLOCK ***** */
  41.  
  42. #include "domstubs.idl"
  43. #include "nsISupports.idl"
  44. #include "nsIRDFCompositeDataSource.idl"
  45. #include "nsIRDFResource.idl"
  46.  
  47. interface nsIXULBuilderListener;
  48.  
  49. [ptr] native nsIContent_ptr(nsIContent);
  50.  
  51. [scriptable, uuid(9da147a7-5854-49e3-a397-22ecdd93e96d)]
  52. interface nsIXULTemplateBuilder : nsISupports
  53. {
  54.     /**
  55.      * The ``root'' node in the DOM to which this builder is attached
  56.      */
  57.     readonly attribute nsIDOMElement root;
  58.  
  59.     /**
  60.      * The composite datasource that the template builder observes
  61.      * and uses to create content
  62.      */
  63.     readonly attribute nsIRDFCompositeDataSource database;
  64.  
  65.     /**
  66.      * Force the template builder to rebuild its content.
  67.      */
  68.     void rebuild();
  69.  
  70.     /**
  71.      * Reload any of our RDF datasources that support nsIRDFRemoteDatasource. 
  72.      *
  73.      * @note This is a temporary hack so that remote-XUL authors can
  74.      *       reload remote datasources. When RDF becomes remote-scriptable,
  75.      *       this will no longer be necessary.
  76.      */
  77.     void refresh();
  78.  
  79.     /**
  80.      * Called to initialize a XUL content builder on a particular root
  81.      * element. This element presumably has a ``datasources''
  82.      * attribute, which the builder will parse to set up the template
  83.      * builder's datasources.
  84.      */
  85.     [noscript] void init(in nsIContent_ptr aElement);
  86.  
  87.     /**
  88.      * Invoked lazily by a XUL element that needs its child content
  89.      * built.
  90.      */
  91.     [noscript] void createContents(in nsIContent_ptr aElement);
  92.  
  93.     /**
  94.      * Add a listener to this template builder. The template builder
  95.      * holds a strong reference to the listener.
  96.      */
  97.     void addListener(in nsIXULBuilderListener aListener);
  98.  
  99.     /**
  100.      * Remove a listener from this template builder.
  101.      */
  102.     void removeListener(in nsIXULBuilderListener aListener);
  103. };
  104.  
  105. /**
  106.  * nsIXULTreeBuilderObserver
  107.  *  This interface allows clients of the XULTreeBuilder to define domain 
  108.  *  specific handling of specific nsITreeView methods that 
  109.  *  XULTreeBuilder does not implement.
  110.  */
  111. [scriptable, uuid(a5480e0d-ac7c-42e5-aca5-d7f0bbffa207)]
  112. interface nsIXULTreeBuilderObserver : nsISupports
  113. {
  114.     const long DROP_BEFORE = -1;
  115.     const long DROP_ON = 0;
  116.     const long DROP_AFTER = 1;
  117.     /**
  118.      * Methods used by the drag feedback code to determine if a drag is allowable at
  119.      * the current location. To get the behavior where drops are only allowed on
  120.      * items, such as the mailNews folder pane, always return false whe
  121.      * the orientation is not DROP_ON.
  122.      */
  123.     boolean canDrop(in long index, in long orientation);
  124.  
  125.     /**
  126.      * Called when the user drops something on this view. The |orientation| param
  127.      * specifies before/on/after the given |row|.
  128.      */
  129.     void onDrop(in long row, in long orientation);
  130.  
  131.     /** 
  132.      * Called when an item is opened or closed. 
  133.      */
  134.       void onToggleOpenState (in long index);
  135.  
  136.     /** 
  137.      * Called when a header is clicked.
  138.      */
  139.     void onCycleHeader(in wstring colID, in nsIDOMElement elt);
  140.  
  141.     /**
  142.      * Called when a cell in a non-selectable cycling column (e.g. 
  143.      * unread/flag/etc.) is clicked.
  144.      */
  145.     void onCycleCell(in long row, in wstring colID);
  146.  
  147.     /** 
  148.      * Called when selection in the tree changes
  149.      */
  150.     void onSelectionChanged();
  151.  
  152.     /**
  153.      * A command API that can be used to invoke commands on the selection.  
  154.      * The tree will automatically invoke this method when certain keys 
  155.      * are pressed.  For example, when the DEL key is pressed, performAction 
  156.      * will be called with the "delete" string. 
  157.      */
  158.     void onPerformAction(in wstring action);
  159.  
  160.     /**
  161.      * A command API that can be used to invoke commands on a specific row.
  162.      */
  163.     void onPerformActionOnRow(in wstring action, in long row);
  164.  
  165.     /**
  166.      * A command API that can be used to invoke commands on a specific cell.
  167.      */
  168.     void onPerformActionOnCell(in wstring action, in long row, in wstring colID);
  169. };
  170.  
  171. [scriptable, uuid(06b31b15-ebf5-4e74-a0e2-6bc0a18a3969)]
  172. interface nsIXULTreeBuilder : nsISupports
  173. {
  174.     /**
  175.      * Retrieve the RDF resource associated with the specified row.
  176.      */
  177.     nsIRDFResource getResourceAtIndex(in long aRowIndex);
  178.  
  179.     /**
  180.      * Retrieve the index associated with specified RDF resource.
  181.      */
  182.     long getIndexOfResource(in nsIRDFResource resource);
  183.  
  184.     /** 
  185.      * Add a Tree Builder Observer to handle Tree View 
  186.      * methods that the base builder does not implement. 
  187.      */
  188.     void addObserver(in nsIXULTreeBuilderObserver aObserver);
  189.  
  190.     /** 
  191.      * Remove an Tree Builder Observer.
  192.      */
  193.     void removeObserver(in nsIXULTreeBuilderObserver aObserver);
  194.  
  195.     /** 
  196.      * Sort the contents of the tree using the specified column.
  197.      */
  198.     void sort(in nsIDOMElement aColumnElement);
  199. };
  200.  
  201.